diff options
| author | Factiven <[email protected]> | 2023-04-19 19:05:51 +0700 |
|---|---|---|
| committer | Factiven <[email protected]> | 2023-04-19 19:05:51 +0700 |
| commit | d1e540bbca923a5500b4da1ffdbe050913677743 (patch) | |
| tree | e0c3e1e94abdf7ec5a049d5dc1ce767ec2d4a1fe /pages/anime/watch/[...info].js | |
| parent | client side rendering (diff) | |
| download | moopa-d1e540bbca923a5500b4da1ffdbe050913677743.tar.xz moopa-d1e540bbca923a5500b4da1ffdbe050913677743.zip | |
Update [...info].js
Diffstat (limited to 'pages/anime/watch/[...info].js')
| -rw-r--r-- | pages/anime/watch/[...info].js | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/pages/anime/watch/[...info].js b/pages/anime/watch/[...info].js index 0b2bd35..d77c23c 100644 --- a/pages/anime/watch/[...info].js +++ b/pages/anime/watch/[...info].js @@ -67,11 +67,17 @@ export default function Info({ sessions, id, aniId }) { // setLoading(true); let epiFallback = null; - const res = await fetch( - `https://api.moopa.my.id/meta/anilist/watch/${id}` - ); - const epiData = await res.json(); - setEpiData(epiData); + try { + const res = await fetch( + `https://api.moopa.my.id/meta/anilist/watch/${id}` + ); + const epiData = await res.json(); + setEpiData(epiData); + } catch (error) { + setTimeout(() => { + window.location.reload(); + }, 3000); + } const res2 = await fetch( `https://api.moopa.my.id/meta/anilist/info/${aniId}` |